home *** CD-ROM | disk | FTP | other *** search
-
- Using SMAK with ASM source files
-
-
-
- SMAK works with ASM, too! If the main source module is named with the
- usual file extension (.ASM or .asm), SMAK will look for directives
- commented off with a semicolon, rather than the default apostrophe.
-
- Note: My knowledge of assemblers is limited to Microsoft's MASM 5.0 and
- Borland's TASM 2.0, which are the only assemblers I have tested SMAK
- with. I would appreciate any information that others can provide me with
- concerning other assemblers that may use a different syntax.
-
-
-
- Entering "SMAK hello.asm" command at the DOS prompt will "make" the
- following sample program using MASM. If you use TASM, enter "SMAK
- hello.asm /2".
-
-
-
- ;==================== Begin program HELLO.ASM ===================
-
- ; Note that SMAK directives are commented off with a semicolon.
-
-
- ;begin MAKE
- ; c:\util\masm\masm ; your assembler program file spec
- ; c:\util\masm\link ; your linker program file spec and options
- ; begin ASM ; source file default extension - source list follows
- ; c:\masm\samples\hello /w2/z ; main source module with assembler options
- ;end MAKE
-
-
- Data_Seg Segment Word Public 'Data'
-
- Msg DB " HELLO! (compiled and linked with SMAK, written in MASM 5.0)",13,10
- MsgLen EQU $ - Msg
-
- Data_Seg Ends
-
-
-
-
- Code_Seg Segment Word Public 'Code'
- Assume CS:Code_Seg, DS:Data_Seg
-
- Begin:
- Mov AX,Data_Seg ; copy Data_Seg address into AX
- Mov DS,AX ; and set DS to that address
-
- Mov BX,1 ; 1 = file handle for standard output
- Mov CX,MsgLen ; CX holds length of message to display
- Mov DX,offset Msg ; DS:DX points to first chr in message
- Mov AH,40h ; DOS Write function number
- Int 21h ; call DOS
-
- Mov AX,4C00h ; DOS Exit function number with errlevel 0
- Int 21h ; call DOS
-
-
- Code_Seg Ends
- End Begin
-
- ;===================== End program HELLO.ASM ====================
-
-